package com.gmj.controller;


import com.gmj.entity.Document;
import com.gmj.entity.Health;
import com.gmj.service.IDocumentService;
import com.gmj.service.IHealthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author gmj
 * @since 2022-01-29
 */
@RestController
@RequestMapping("/health")
public class HealthController {
    @Autowired
    private IHealthService hs;
    @GetMapping("/selectAll")
    public List<Health> selectAll(){
        return hs.list();
    }
    @PostMapping("/add")
    public void add(@RequestBody Health health){
        hs.save(health);
    }

    @DeleteMapping("/delete/{id}")
    public void delete(@PathVariable("id") int id){
        hs.removeById(id);
    }
}

